package com.kindsoft.demo.ldap;

import lombok.Data;
import org.springframework.ldap.odm.annotations.Attribute;
import org.springframework.ldap.odm.annotations.Entry;
import org.springframework.ldap.odm.annotations.Id;

import javax.naming.Name;

/**
 * Created by zhoujm on 2020/2/20/020.
 */
@Data
@Entry(base = "ou=People,dc=seecent,dc=com", objectClasses = {"OrganizationalPerson", "Person", "top"})
public class LdapUser {

    @Id
    private Name id;

    @Attribute(name = "cn")
    private String commonName;

    @Attribute(name = "sn")
    private String userName;

    public Name getId() {
        return id;
    }

    public void setId(Name id) {
        this.id = id;
    }

    public String getCommonName() {
        return commonName;
    }

    public void setCommonName(String commonName) {
        this.commonName = commonName;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Override
    public String toString() {
        return "LdapUser{" +
                "id=" + id +
                ", commonName='" + commonName + '\'' +
                ", userName='" + userName + '\'' +
                '}';
    }
}
